#include "common.h"

#ifndef __CONDITION__
#define __CONDITION__

namespace GXL_Engine
{
	class Condition
	{
	public:
		Condition()
		{
			m_hEvent = 	::CreateEvent(NULL, FALSE, FALSE, NULL );
		}
		~Condition()
		{
			CloseHandle(m_hEvent);
		}
		VOID Wait()
		{
			::WaitForSingleObjectEx(m_hEvent, INFINITE, FALSE);
		}
		VOID Signal()
		{
			SetEvent(m_hEvent);
		}

	private:
		HANDLE	m_hEvent;
	};
}//namespace GXL_Engine
#endif//__CONDITION__